//
//  Extension+UILabel.swift
//  SZZweibo
//
//  Created by 申壮壮 on 16/8/14.
//  Copyright © 2016年 itcast. All rights reserved.
//

import UIKit


extension UILabel{
    
    
    convenience init(textColor: UIColor, textSize: CGFloat, maxWith:CGFloat = 0){
        
        self.init()
        
        //设置textColor
        self.textColor = textColor
        
        //设置textSize
        self.font = UIFont.systemFontOfSize(textSize)
        
        if maxWith > 0  {
            
            self.numberOfLines = 0
            
            self.preferredMaxLayoutWidth = maxWith
        }
       
    }

}
